
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Go 语言数据类型 · itcode</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="wangmaolin">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Go语言变量&变量声明.html" />
    
    
    <link rel="prev" href="Go语言基础语法.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://itcode.wiki" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    Go语言学习
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Go语言环境安装.html">
            
                <a href="Go语言环境安装.html">
            
                    
                    Go 语言环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="Go语言结构.html">
            
                <a href="Go语言结构.html">
            
                    
                    Go 语言结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="Go语言基础语法.html">
            
                <a href="Go语言基础语法.html">
            
                    
                    Go 语言基础语法
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.4" data-path="Go语言数据类型.html">
            
                <a href="Go语言数据类型.html">
            
                    
                    Go 语言数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="Go语言变量&变量声明.html">
            
                <a href="Go语言变量&变量声明.html">
            
                    
                    Go 语言变量 & 变量声明
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Go 语言数据类型</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x5728; Go &#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x4E2D;&#xFF0C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7528;&#x4E8E;&#x58F0;&#x660E;&#x51FD;&#x6570;&#x548C;&#x53D8;&#x91CF;&#x3002;</p>
<pre><code>&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x51FA;&#x73B0;&#x662F;&#x4E3A;&#x4E86;&#x628A;&#x6570;&#x636E;&#x5206;&#x6210;&#x6240;&#x9700;&#x5185;&#x5B58;&#x5927;&#x5C0F;&#x4E0D;&#x540C;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x7F16;&#x7A0B;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#x7528;&#x5927;&#x6570;&#x636E;&#x7684;&#x65F6;&#x5019;&#x624D;&#x9700;&#x8981;&#x7533;&#x8BF7;&#x5927;&#x5185;&#x5B58;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x5145;&#x5206;&#x5229;&#x7528;&#x5185;&#x5B58;&#x3002;
</code></pre><h1 id="go-&#x8BED;&#x8A00;&#x6309;&#x7C7B;&#x522B;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF1A;"><a name="go-&#x8BED;&#x8A00;&#x6309;&#x7C7B;&#x522B;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF1A;" class="plugin-anchor" href="#go-&#x8BED;&#x8A00;&#x6309;&#x7C7B;&#x522B;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF1A;"><i class="fa fa-link" aria-hidden="true"></i></a>Go &#x8BED;&#x8A00;&#x6309;&#x7C7B;&#x522B;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF1A;</h1>
<pre><code>&#x5E03;&#x5C14;&#x578B;
    &#x5E03;&#x5C14;&#x578B;&#x7684;&#x503C;&#x53EA;&#x53EF;&#x4EE5;&#x662F;&#x5E38;&#x91CF; true &#x6216;&#x8005; false&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A; false&#x3002;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x4F8B;&#x5B50;&#xFF1A;var b bool = true&#x3002;
&#x6570;&#x5B57;&#x7C7B;&#x578B;
    &#x6574;&#x578B; int &#x548C;&#x6D6E;&#x70B9;&#x578B; float32&#x3001;float64&#xFF0C;Go &#x8BED;&#x8A00;&#x652F;&#x6301;&#x6574;&#x578B;&#x548C;&#x6D6E;&#x70B9;&#x578B;&#x6570;&#x5B57;&#xFF0C;&#x5E76;&#x4E14;&#x539F;&#x751F;&#x652F;&#x6301;&#x590D;&#x6570;&#xFF0C;&#x5176;&#x4E2D;&#x4F4D;&#x7684;&#x8FD0;&#x7B97;&#x91C7;&#x7528;&#x8865;&#x7801;&#x3002;
    &#x5305;&#x62EC;&#xFF1A;
    uint8    &#x65E0;&#x7B26;&#x53F7; 8 &#x4F4D;&#x6574;&#x578B; (0 &#x5230; 255)
    uint16    &#x65E0;&#x7B26;&#x53F7; 16 &#x4F4D;&#x6574;&#x578B; (0 &#x5230; 65535)
    uint32    &#x65E0;&#x7B26;&#x53F7; 32 &#x4F4D;&#x6574;&#x578B; (0 &#x5230; 4294967295)
    uint64    &#x65E0;&#x7B26;&#x53F7; 64 &#x4F4D;&#x6574;&#x578B; (0 &#x5230; 18446744073709551615)
    int8    &#x6709;&#x7B26;&#x53F7; 8 &#x4F4D;&#x6574;&#x578B; (-128 &#x5230; 127)
    int16    &#x6709;&#x7B26;&#x53F7; 16 &#x4F4D;&#x6574;&#x578B; (-32768 &#x5230; 32767)
    int32    &#x6709;&#x7B26;&#x53F7; 32 &#x4F4D;&#x6574;&#x578B; (-2147483648 &#x5230; 2147483647)
    int64    &#x6709;&#x7B26;&#x53F7; 64 &#x4F4D;&#x6574;&#x578B; (-9223372036854775808 &#x5230; 9223372036854775807)
    float32    IEEE-754 32&#x4F4D;&#x6D6E;&#x70B9;&#x578B;&#x6570;
    float64    IEEE-754 64&#x4F4D;&#x6D6E;&#x70B9;&#x578B;&#x6570;
    complex64    32 &#x4F4D;&#x5B9E;&#x6570;&#x548C;&#x865A;&#x6570;
    complex128    64 &#x4F4D;&#x5B9E;&#x6570;&#x548C;&#x865A;&#x6570;
    byte    &#x7C7B;&#x4F3C; uint8
    rune    &#x7C7B;&#x4F3C; int32
    uint    32 &#x6216; 64 &#x4F4D;
    int    &#x4E0E; uint &#x4E00;&#x6837;&#x5927;&#x5C0F;
    uintptr    &#x65E0;&#x7B26;&#x53F7;&#x6574;&#x578B;&#xFF0C;&#x7528;&#x4E8E;&#x5B58;&#x653E;&#x4E00;&#x4E2A;&#x6307;&#x9488;
&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;:
    &#x5B57;&#x7B26;&#x4E32;&#x5C31;&#x662F;&#x4E00;&#x4E32;&#x56FA;&#x5B9A;&#x957F;&#x5EA6;&#x7684;&#x5B57;&#x7B26;&#x8FDE;&#x63A5;&#x8D77;&#x6765;&#x7684;&#x5B57;&#x7B26;&#x5E8F;&#x5217;&#x3002;Go&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x7531;&#x5355;&#x4E2A;&#x5B57;&#x8282;&#x8FDE;&#x63A5;&#x8D77;&#x6765;&#x7684;&#x3002;
    Go&#x8BED;&#x8A00;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x5B57;&#x8282;&#x4F7F;&#x7528;UTF-8&#x7F16;&#x7801;&#x6807;&#x8BC6;Unicode&#x6587;&#x672C;&#x3002;
&#x6D3E;&#x751F;&#x7C7B;&#x578B;:
    &#x5305;&#x62EC;&#xFF1A;
    (a) &#x6307;&#x9488;&#x7C7B;&#x578B;&#xFF08;Pointer&#xFF09;
    (b) &#x6570;&#x7EC4;&#x7C7B;&#x578B;
    (c) &#x7ED3;&#x6784;&#x5316;&#x7C7B;&#x578B;(struct)
    (d) Channel &#x7C7B;&#x578B;
    (e) &#x51FD;&#x6570;&#x7C7B;&#x578B;
    (f) &#x5207;&#x7247;&#x7C7B;&#x578B;
    (g) &#x63A5;&#x53E3;&#x7C7B;&#x578B;&#xFF08;interface&#xFF09;
    (h) Map &#x7C7B;&#x578B;
</code></pre><footer class="page-footer"><span class="copyright">Copyright &#xA9; wml 2018 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-07-08 14:58:39
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Go语言基础语法.html" class="navigation navigation-prev " aria-label="Previous page: Go 语言基础语法">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Go语言变量&变量声明.html" class="navigation navigation-next " aria-label="Next page: Go 语言变量 & 变量声明">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Go 语言数据类型","level":"1.2.4","depth":2,"next":{"title":"Go 语言变量 & 变量声明","level":"1.2.5","depth":2,"path":"category/go/Go语言变量&变量声明.md","ref":"category/go/Go语言变量&变量声明.md","articles":[]},"previous":{"title":"Go 语言基础语法","level":"1.2.3","depth":2,"path":"category/go/Go语言基础语法.md","ref":"category/go/Go语言基础语法.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-pro","toggle-chapters","splitter","donate","github","edit-link","advanced-emoji","tbfed-pagefooter","simple-page-toc","baidu","changyan","anchors","sitemap-general","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy wml 2018","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/wmlhub/gitbook/tree/master"},"livereload":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":false},"splitter":{},"search-pro":{"cutWordLib":"nodejieba","defineWord":["gitbook-use"]},"donate":{"alipay":"","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"","wechatText":"微信打赏"},"sitemap-general":{"prefix":"http://itcode.wiki"},"changyan":{"appid":"cytowLiqM","conf":"the conf in the code generate by changyan"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sitemap":{"hostname":"https://wmlhub.gitee.io/gitbook/"},"baidu":{"token":"084b900a1e26f6bae60e09d18e3aa455"},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://gitee.com/wmlhub/gitbook/tree/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{}},"theme":"default","author":"wangmaolin","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"itcode","language":"zh-hans","links":{"sidebar":{"Home":"http://itcode.wiki"}},"gitbook":"3.2.3","description":"记录自己日常学习总结"},"file":{"path":"category/go/Go语言数据类型.md","mtime":"2018-07-08T06:58:39.213Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-07-08T07:27:40.150Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-baidu/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-changyan/changyan.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

